import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue' 
import Panel from '../views/Panel.vue';
import Home from "../components/Home.vue"; // 导入你的组件文件
import UserManagement from "../components/UserManagement.vue";
import MenuManagement from "../components/MenuManagement.vue";
import RoleManagement from "../components/RoleManagement.vue";
import PosterManagement from "../components/PosterManagement.vue";
import MaterialManagement from "../components/MaterialManagement.vue";

Vue.use(VueRouter)

const routes = [
  // 重定向login
  {
    path:'/',
    redirect:'/login'
  },
  {
    path:'/login',
    component:Login
  },
  {
    path:'/register',
    component:Register
  },
  {
    path: '/panel',
    component: Panel
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/userManagement',
    component: UserManagement
  },
  {
    path: '/menuManagement',
    component: MenuManagement
  },
  {
    path: '/roleManagement',
    component: RoleManagement
  },
  {
    path: '/posterManagement',
    component: PosterManagement
  },
  {
    path: '/materialManagement',
    component: MaterialManagement
  },
]

const router = new VueRouter({
  routes
})

export default router
